package com.zwk.cms.controller;

import com.zwk.base.entity.CommonResult;
import com.zwk.cms.entity.CrmBanner;
import com.zwk.cms.service.CrmBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zwk
 * @create 2022/8/27 16:56
 */
@RestController
@RequestMapping("/cms/banner/front")
@CrossOrigin
public class BannerUserController {

    @Autowired
    private CrmBannerService bannerService;

    // 查询所有banner
    @GetMapping("/findAllBanner")
    public CommonResult findAllBanner(){

        List<CrmBanner> banners = bannerService.selectAllBanner();

        return CommonResult.ok().data("list", banners);
    }

}
